<template>
  <div class="root-container">
    <mcard v-for="citem in cardItems" :items="citem.items" :ctitle="citem.title" :key="citem.title"></mcard>
  </div>
</template>
<script>
import {get} from '@/util'
import mcard from '@/components/monster/Mcard'
import mitem from '@/components/monster/Mitem'
export default {
  data () {
    return {
      cardItems: []
    }
  },
  components: {
    mitem,
    mcard
  },
  methods: {
    async getList () {
      wx.showNavigationBarLoading()
      const mlist = await get('/weapp/monster', null)
      wx.hideNavigationBarLoading()
      this.cardItems = mlist
    }
  },
  mounted () {
    this.getList()
  },
  onPullDownRefresh () {
    this.getList()
  }
}
</script>
<style scoped>
  .root-container{
    background-color: #eee;
    min-height: 100vh;
  }
</style>


